#ifndef __MCMATRIX3_H_
#define __MCMATRIX3_H_

#include <array>

class MCVector2;
class MCPoint2D;

class MCMatrix3
{
public:

    MCMatrix3();
    MCMatrix3(double m11_, double m12_, double m13_,
              double m21_, double m22_, double m23_,
              double m31_, double m32_, double m33_);
    
    static MCMatrix3 identity();
    static MCMatrix3 translate(const MCVector2 &v);
    static MCMatrix3 scale(double sx, double sy);
    static MCMatrix3 rotateInRadian(double angle);
    static MCMatrix3 rotateInDegrees(double angle);

    void print() const;

    friend void operator+=(MCMatrix3 &m, double scalar);
    friend void operator*=(MCMatrix3 &m, double scalar);
    friend void operator+=(MCMatrix3 &m1, MCMatrix3 &m2);
    friend void operator-=(MCMatrix3 &m1, MCMatrix3 &m2);
    friend MCPoint2D operator*(const MCPoint2D &p, const MCMatrix3 &m);

public:

    double m11, m12, m13;
    double m21, m22, m23;
    double m31, m32, m33;

};

#endif // !__MCMATRIX3_H_
